home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-08-08 | 30.4 KB | 1,055 lines | [TEXT/CWIE] |
- //
- // GrayCouncilPP
- // Copyright ©1996 by Trygve Isaacson. All Rights Reserved.
- //
- // PowerPlant adapter classes for core Gray Council.
- //
- // Before using any of the GrayCouncil source code, read and
- // follow the licensing info in the accompanying documentation
- // or contact:
- // <trygve@kagi.com>
- // <http://www.kagi.com/authors/trygve/>
- //
- // GrayCouncil provides a set of standard C++ classes that implement
- // the standard Apple Grayscale Appearance. The core classes do not
- // require any other code such as a particular class framework.
- //
- // This file defines a set of helper classes that derive from standard
- // PowerPlant pane classes, and interface with the core Gray Council code.
- // There are also a couple of attachment subclasses for attaching to
- // other pane classes to get a white background and 3D frame.
- //
- // Normally, to use a GrayCouncil PowerPlant class, you can simply change the
- // class ID of the pane in your Constructor window resource to the
- // class ID of the appropriate Gray Council PowerPlant adapter class. For
- // example, to use the GC pushbutton, create a normal LButton pane,
- // and set its class ID to 'GCpb'. Voila. This also works for the LAttachment
- // subclasses defined here.
- //
- // A couple of the classes use the mUserCon field of the subview to specify
- // additional information such as icon IDs, string resource IDs, etc.
- //
- // If the mUserCon usage conflicts with what you are already doing with it,
- // you can use the "extended" pane subclasses (those whose class name ends
- // in "PPX" instead of "PP"). These classes read their additional info from
- // the pane resource stream instead of using mUserCon. In some cases they
- // let you specify additional options in the pane resource that you would
- // otherwise have to specify programmatically. The supplied resource file
- // named GCCustomPanes.rsrc contains the 'CPPb' custom pane types.
- // If you put this file in the Constructor app's folder, or keep it open
- // whenever your pane resource file is open, or paste the custom pane
- // types into your pane resource file, you can use the extended pane classes
- // in Constructor.
- //
- // Each class here that interfaces to a core AGAObject has a public
- // member variable called mAGAObject that points to the actual AGAObject
- // subclass object. Certain extended object settings (such as mixed-state
- // buttons, proportional and live scrolling, etc.) require you to call
- // the AGAObject to set it. The member variable is made public to keep
- // these PowerPlant classes as lightweight as possible; you make the call,
- // rather than using myriad new functions of the PowerPlant AGA subclasses.
- //
- // Classes defined below:
- // AGAWindowPP -- LWindow subclass that draws a modeless window gray
- // background.
- // AGADialogBoxPP -- LDialogBox subclass that draws a modal window gray
- // background and replaces the PowerPlant default button outline by
- // altering the style of the default button AGAPushButton object.
- // AGAPushButtonPP -- LStdButton subclass for AGAPushButton.
- // AGACheckBoxPP -- LStdCheckBox subclass for AGACheckBox.
- // AGARadioButtonPP -- LStdRadioButton subclass for AGARadioButton.
- // AGAIconPushButtonPP -- AGAPushButtonPP (LStdButton) subclass for
- // AGAIconPushButton.
- // AGAIconPushButtonPPX -- AGAIconPushButtonPP (LStdButton) subclass for
- // AGAIconPushButton, that uses extended CPPb data for the icon ID.
- // AGAIconCheckBoxPP -- AGACheckBoxPP (LStdCheckBox) subclass for
- // AGAIconCheckBox.
- // AGAIconCheckBoxPPX -- AGAIconCheckBoxPP (LStdCheckBox) subclass for
- // AGAIconCheckBox, that uses extended CPPb data for the icon IDs.
- // AGAIconRadioButtonPP -- AGARadioButtonPP (LStdRadioButton) subclass
- // for AGAIconRadioButton.
- // AGAIconRadioButtonPPX -- AGAIconRadioButtonPP (LStdRadioButton) subclass
- // for AGAIconRadioButton, that uses extended CPPb data for the icon IDs.
- // AGAIconRadioButtonMA -- AGARadioButtonMA (LStdRadioButton) subclass for
- // AGAIconRadioButton.
- // AGAGroupBoxPP -- LGroupBox subclass for AGAGroupBox, with primary group
- // box appearance.
- // AGAGroupBoxPPX -- AGAGroupBoxPP (LGroupBox) subclass for AGAGroupBox,
- // that uses extended CPPb data for the box type and gap pane ID.
- // AGASecondaryGroupBoxPP -- AGAGroupBoxPP (LGroupBox) subclass for
- // AGAGroupBox, with secondary group box appearance.
- // AGAScrollBarPP -- LStdControl subclass for AGAScrollBar.
- // AGAScrollerPP -- LScroller subclass that replaces the normal LStdControl
- // scroll bars with ones of class AGAScrollBarPP, and correctly
- // maintain them during scrolling.
- // AGASliderPP -- LControl subclass for AGASlider.
- // AGASliderPPX -- AGASliderPP (LControl) subclass for AGASlider, that
- // uses extended CPPb data for the label strings ID, style, and
- // slider justification.
- // AGALittleArrowsPP -- LControl subclass for AGALittleArrows.
- // AGALittleArrowsPPX -- AGALittleArrowsPP (LControl) subclass for
- // AGALittleArrows, that uses extended CPPb data for the linked
- // numeric LEditField pane ID.
- // AGAPopupMenuPP -- LStdPopupMenu subclass for AGAPopupMenu.
- // AGADisclosureTrianglePP -- LControl subclass for AGADisclosureTriangle.
- // AGAProgressIndicatorPP -- LControl subclass for AGAProgressIndicator.
- // AGAWhiteBackgroundAttachmentPP -- LAttachment subclass that draws a
- // white background for the pane to which it is attached.
- // AGABorderFrameAttachmentPP -- LAttachment subclass that draws a
- // "3D" sunken frame around the pane to which it is attached.
- // AGAEditFieldPP -- LEditField subclass that automatically attaches an
- // AGAWhiteBackgroundAttachmentPP and an AGABorderFrameAttachmentPP,
- // and also knows how to draw the frame in disabled gray when disabled.
- // AGATextEditPP -- LTextEdit subclass that automatically attaches an
- // AGAWhiteBackgroundAttachmentPP and an AGABorderFrameAttachmentPP.
- // AGASeparatorPP -- LPane subclass for AGASeparator.
- // AGACaptionPP -- LCaption subclass for AGAStaticText.
- // AGAFocusBoxPP -- LFocusBox subclass used by AGAListBox to draw the
- // list box focus frame.
- // AGAListBoxPP -- LListBox subclass that automatically attaches an
- // AGAWhiteBackgroundAttachmentPP and an AGABorderFrameAttachmentPP,
- // and also replaces the normal LFocusBox with an AGAFocusBoxPP so
- // that the focus frame appears correct.
- //
-
- #ifndef __GRAYCOUNCILPP__
- #define __GRAYCOUNCILMA__
-
- #include "GrayCouncil.h"
-
- #include "LGroupBox.h"
-
- //
- // You must call InitGrayCouncilPP after initializing PowerPlant and the
- // Toolbox and before instantiating any GrayCouncil objects. This routine
- // registers the PowerPlant classes and then calls the core InitGrayCouncil
- // function for you. If it returns an error, you should quit. The only
- // current error situation of this is an out-of-memory condition
- // during initialization.
- //
-
- extern OSErr InitGrayCouncilPP();
-
- //
- // AGAWindowPP ----------------------------------------------------
- //
- // LWindow replacement subclass.
- // Makes sure the background is modeless shaded gray.
- // Knows how to shade around the grow box.
- //
-
- class AGAWindowPP : public LWindow
- {
- public:
-
- AGAWindowPP(LStream* inStream);
- virtual ~AGAWindowPP();
-
- enum { class_ID = 'GCwn' };
- static AGAWindowPP* CreateStream(LStream* inStream);
-
- // PowerPlant overrides
- virtual void FinishCreate();
- virtual void DrawSelf();
- virtual void ResizeFrameBy(Int16 inWidthDelta, Int16 inHeightDelta, Boolean inRefresh);
-
- protected:
-
- // PowerPlant overrides
- virtual void FinishCreateSelf();
- virtual void ActivateSelf();
- virtual void DeactivateSelf();
-
- virtual void DrawBackground(const Rect* area, Boolean fill, Boolean active);
- virtual void InvalidateEdges(Boolean before, Int16 inWidthDelta, Int16 inHeightDelta);
- };
-
- //
- // AGADialogBoxPP ----------------------------------------------------
- //
- // LDialogBox replacement subclass.
- // Makes sure the background is modal shaded gray and the default
- // button is drawn with an AGA-style default outline.
- // Knows how to shade around the grow box.
- //
-
- class AGADialogBoxPP : public LDialogBox
- {
- public:
-
- AGADialogBoxPP(LStream* inStream);
- virtual ~AGADialogBoxPP();
-
- enum { class_ID = 'GCdb' };
- static AGADialogBoxPP* CreateStream(LStream* inStream);
-
- // PowerPlant overrides
- virtual void FinishCreate();
- virtual void SetDefaultButton(PaneIDT inButtonID);
- virtual void DrawSelf();
- virtual void ResizeFrameBy(Int16 inWidthDelta, Int16 inHeightDelta, Boolean inRefresh);
-
- protected:
-
- // PowerPlant overrides
- virtual void FinishCreateSelf();
- virtual void ActivateSelf();
- virtual void DeactivateSelf();
-
- virtual void DrawBackground(const Rect* area, Boolean fill, Boolean active);
- virtual void InvalidateEdges(Boolean before, Int16 inWidthDelta, Int16 inHeightDelta);
-
- Boolean mDeleteDefaultOutline;
- };
-
- //
- // AGAPushButtonPP ----------------------------------------------------
- //
- // LStdButton replacement subclass.
- //
-
- class AGAPushButtonPP : public LStdButton
- {
- public:
-
- AGAPushButtonPP(LStream* inStream);
- virtual ~AGAPushButtonPP();
-
- AGAPushButton* mAGAObject;
-
- enum { class_ID = 'GCpb' };
- static AGAPushButtonPP* CreateStream(LStream* inStream);
-
- protected:
-
- // PowerPlant overrides
- virtual void FinishCreateSelf();
- virtual void DrawSelf();
- virtual void ClickSelf(const SMouseDownEvent &inMouseDown);
- virtual void HotSpotAction(SInt16 inHotSpot, Boolean inCurrInside, Boolean inPrevInside);
- virtual void EnableSelf();
- virtual void DisableSelf();
- virtual void ShowSelf();
-
- virtual void CreateAGAObject();
- };
-
- //
- // AGACheckBoxPP ----------------------------------------------------
- //
- // LStdCheckBox replacement subclass. To use mixed-state capability,
- // set/get the AGACheckBox state directly.
- //
-
- class AGACheckBoxPP : public LStdCheckBox
- {
- public:
-
- AGACheckBoxPP(LStream* inStream);
- virtual ~AGACheckBoxPP();
-
- AGACheckBox* mAGAObject;
-
- enum { class_ID = 'GCcb' };
- static AGACheckBoxPP* CreateStream(LStream* inStream);
-
- // PowerPlant overrides
- virtual void SetValue(SInt32 inValue);
-
- protected:
-
- // PowerPlant overrides
- virtual void FinishCreateSelf();
- virtual void DrawSelf();
- virtual void ClickSelf(const SMouseDownEvent &inMouseDown);
- virtual void HotSpotAction(SInt16 inHotSpot, Boolean inCurrInside, Boolean inPrevInside);
- virtual void EnableSelf();
- virtual void DisableSelf();
- virtual void ShowSelf();
-
- virtual void CreateAGAObject();
- };
-
- //
- // AGARadioButtonPP ----------------------------------------------------
- //
- // LStdRadioButton replacement subclass. To use mixed-state capability,
- // set/get the AGARadioButton state directly.
- //
-
- class AGARadioButtonPP : public LStdRadioButton
- {
- public:
-
- AGARadioButtonPP(LStream* inStream);
- virtual ~AGARadioButtonPP();
-
- AGARadioButton* mAGAObject;
-
- enum { class_ID = 'GCrb' };
- static AGARadioButtonPP* CreateStream(LStream* inStream);
-
- // PowerPlant overrides
- virtual void SetValue(SInt32 inValue);
-
- protected:
-
- // PowerPlant overrides
- virtual void FinishCreateSelf();
- virtual void DrawSelf();
- virtual void ClickSelf(const SMouseDownEvent &inMouseDown);
- virtual void HotSpotAction(SInt16 inHotSpot, Boolean inCurrInside, Boolean inPrevInside);
- virtual void EnableSelf();
- virtual void DisableSelf();
- virtual void ShowSelf();
-
- virtual void CreateAGAObject();
- };
-
- //
- // AGAIconPushButtonPP ----------------------------------------------------
- //
- // LStdButton replacement subclass that implements an icon button that behaves
- // like an LStdButton -- you click it does its HotSpotResult. The mUserCon is
- // used to obtain the button's icon ID. You can also set the icon ID of the
- // AGAIconPushButton directly (cast the mAGAObject to AGAIconPushButton*).
- //
-
- class AGAIconPushButtonPP : public AGAPushButtonPP
- {
- public:
-
- AGAIconPushButtonPP(LStream* inStream);
- virtual ~AGAIconPushButtonPP();
-
- enum { class_ID = 'GCip' };
- static AGAIconPushButtonPP* CreateStream(LStream* inStream);
-
- protected:
-
- virtual void CreateAGAObject();
-
- // Extra AGA object initialization values
- SInt16 mIconID;
- };
-
- //
- // AGAIconPushButtonPPX ----------------------------------------------------
- //
- // Extended AGAIconPushButtonPP class for use with custom pane template.
- // The icon ID is read from the stream.
- //
-
- class AGAIconPushButtonPPX : public AGAIconPushButtonPP
- {
- public:
-
- AGAIconPushButtonPPX(LStream* inStream);
- virtual ~AGAIconPushButtonPPX();
-
- enum { class_ID = 'GXip' };
- static AGAIconPushButtonPPX* CreateStream(LStream* inStream);
- };
-
- //
- // AGAIconCheckBoxPP ----------------------------------------------------
- //
- // LStdCheckBox replacement subclass that implements an icon button that behaves
- // like a check box -- you click it and it toggles its on/off state. The mUserCon
- // is used to obtain the button's icon ID. You can also set the icon ID of the
- // AGAIconCheckBox directly (cast the mAGAObject to AGAIconCheckBox*). If you want
- // the on/off states to have different icons, you can specify different icon IDs.
- //
-
- class AGAIconCheckBoxPP : public AGACheckBoxPP
- {
- public:
-
- AGAIconCheckBoxPP(LStream* inStream);
- virtual ~AGAIconCheckBoxPP();
-
- enum { class_ID = 'GCic' };
- static AGAIconCheckBoxPP* CreateStream(LStream* inStream);
-
- protected:
-
- virtual void CreateAGAObject();
-
- // Extra AGA object initialization values
- SInt16 mOffIconID;
- SInt16 mOnIconID;
- };
-
- //
- // AGAIconCheckBoxPPX ----------------------------------------------------
- //
- // Extended AGAIconCheckBoxPP class for use with custom pane template.
- // The off and on icon IDs are read from the stream.
- //
-
- class AGAIconCheckBoxPPX : public AGAIconCheckBoxPP
- {
- public:
-
- AGAIconCheckBoxPPX(LStream* inStream);
- virtual ~AGAIconCheckBoxPPX();
-
- enum { class_ID = 'GXic' };
- static AGAIconCheckBoxPPX* CreateStream(LStream* inStream);
- };
-
- //
- // AGAIconRadioButtonPP ----------------------------------------------------
- //
- // LStdRadioButton replacement subclass that implements an icon button that behaves
- // like a radio button -- you click it and it turns on, and the others in its
- // tab group are turned off. The mUserCon is used to obtain the
- // button's icon ID. You can also set the icon ID of the AGAIconRadioButton
- // directly (cast the mAGAObject to AGAIconRadioButton*). If you want the on/off
- // states to have different icons, you can specify different icon IDs.
- //
-
- class AGAIconRadioButtonPP : public AGARadioButtonPP
- {
- public:
-
- AGAIconRadioButtonPP(LStream* inStream);
- virtual ~AGAIconRadioButtonPP();
-
- enum { class_ID = 'GCir' };
- static AGAIconRadioButtonPP* CreateStream(LStream* inStream);
-
- protected:
-
- virtual void CreateAGAObject();
-
- // Extra AGA object initialization values
- SInt16 mOffIconID;
- SInt16 mOnIconID;
- };
-
- //
- // AGAIconRadioButtonPPX ----------------------------------------------------
- //
- // Extended AGAIconRadioButtonPP class for use with custom pane template.
- // The off and on icon IDs are read from the stream.
- //
-
- class AGAIconRadioButtonPPX : public AGAIconRadioButtonPP
- {
- public:
-
- AGAIconRadioButtonPPX(LStream* inStream);
- virtual ~AGAIconRadioButtonPPX();
-
- enum { class_ID = 'GXir' };
- static AGAIconRadioButtonPPX* CreateStream(LStream* inStream);
- };
-
- //
- // AGAGroupBoxPP ----------------------------------------------------
- //
- // LGroupBox replacement subclass. Defaults to primary group box type.
- //
-
- class AGAGroupBoxPP : public LGroupBox
- {
- public:
-
- AGAGroupBoxPP(LStream* inStream);
- virtual ~AGAGroupBoxPP();
-
- AGAGroupBox* mAGAObject;
-
- enum { class_ID = 'GCgb' };
- static AGAGroupBoxPP* CreateStream(LStream* inStream);
-
- protected:
-
- // PowerPlant overrides
- virtual void FinishCreateSelf();
- virtual void DrawSelf();
- virtual void EnableSelf();
- virtual void DisableSelf();
-
- virtual void CreateAGAObject();
-
- // Extra AGA object initialization values
- Boolean mIsPrimaryGroup;
- OSType mGapPaneID;
- };
-
- //
- // AGAGroupBoxPPX ----------------------------------------------------
- //
- // Extended AGAGroupBoxPP class for use with custom pane template.
- // The group box type and the gap pane ID are read from the stream.
- //
-
- class AGAGroupBoxPPX : public AGAGroupBoxPP
- {
- public:
-
- AGAGroupBoxPPX(LStream* inStream);
- virtual ~AGAGroupBoxPPX();
-
- enum { class_ID = 'GXgb' };
- static AGAGroupBoxPPX* CreateStream(LStream* inStream);
- };
-
- //
- // AGASecondaryGroupBoxPP ----------------------------------------------------
- //
- // LGroupBox replacement subclass with secondary group box type.
- //
-
- class AGASecondaryGroupBoxPP : public AGAGroupBoxPP
- {
- public:
-
- AGASecondaryGroupBoxPP(LStream* inStream);
- virtual ~AGASecondaryGroupBoxPP();
-
- enum { class_ID = 'GCgs' };
- static AGASecondaryGroupBoxPP* CreateStream(LStream* inStream);
- };
-
- //
- // AGAScrollBarPP -------------------------------------------------------
- //
- // LStdControl/scrollBarProc replacement subclass. To use live scrolling, set the
- // AGAScrollBar state directly and either install a notification routine
- // or handle the scroll bar's fEventNumber by checking the current value.
- // To use proportional indicator, set the AGAScrollBar state directly.
- //
- // Note that LScroller instantiates its scroll bars for you, so you
- // don't need to know about this class when it's being used as part of
- // an AGAScrollerPP (LScroller).
- //
-
- typedef void (*AGANotifyPPPtr)(LPane* theIndicator, SInt32 dataValue, void* userData);
-
- class AGAScrollBarPP : public LStdControl
- {
- public:
-
- AGAScrollBarPP(LStream* inStream);
- AGAScrollBarPP(const SPaneInfo &inPaneInfo,
- MessageT inValueMessage,
- Int32 inValue,
- Int32 inMinValue,
- Int32 inMaxValue,
- Int16 inControlKind,
- ResIDT inTextTraitsID,
- Str255 inTitle,
- Int32 inMacRefCon);
- virtual ~AGAScrollBarPP();
-
- AGAScrollBar* mAGAObject;
-
- enum { class_ID = 'GCsb' };
- static AGAScrollBarPP* CreateStream(LStream* inStream);
-
- // PowerPlant overrides
- virtual void SetValue(SInt32 inValue);
- virtual void SetMinValue(SInt32 inMinValue);
- virtual void SetMaxValue(SInt32 inMaxValue);
-
- virtual void InstallNotificationRoutine(AGANotifyPPPtr notificationRoutine, void* userData);
- virtual void HandleNotification(SInt32 dataValue);
-
- AGANotifyPPPtr mNotificationRoutine;
- void* mUserData;
-
- protected:
-
- // PowerPlant overrides
- virtual void FinishCreateSelf();
- virtual void DrawSelf();
- virtual void ClickSelf(const SMouseDownEvent &inMouseDown);
- virtual void EnableSelf();
- virtual void DisableSelf();
- virtual void ShowSelf();
-
- virtual void CreateAGAObject();
-
- static void RealAGANotifier(AGATrackingIndicator* theIndicator, SInt32 dataValue, void* userData);
- };
-
- //
- // AGAScrollerPP ----------------------------------------------------
- //
- // LScroller replacement subclass that creates AGAScrollBarPP objects
- // rather than LStdControl/scrollBarProc objects.
- //
- // The problem is that there's no single bottleneck for creating
- // the scroll bars. MakeScrollBars is declared private, so we cannot
- // override that. Basically we have to postprocess each constructor
- // and make new scroll bars to replace the old ones.
- //
-
- class AGAScrollerPP : public LScroller
- {
- public:
-
- AGAScrollerPP(LStream* inStream);
- virtual ~AGAScrollerPP();
-
- enum { class_ID = 'GCsc' };
- static AGAScrollerPP* CreateStream(LStream* inStream);
-
- virtual void HandleNotification(LPane* theScrollBar, SInt32 dataValue);
-
- protected:
-
- // PowerPlant overrides
- virtual void FinishCreateSelf();
- virtual void AdjustScrollBars();
-
- virtual void MakeCustomScrollBars(Int16 inHorizBarLeftIndent, Int16 inHorizBarRightIndent, Int16 inVertBarTopIndent, Int16 inVertBarBottomIndent);
-
- LStdControl *mOldVerticalBar;
- LStdControl *mOldHorizontalBar;
-
- static void ScrollBarNotifier(LPane* theScrollBar, SInt32 dataValue, void* userData);
- };
-
- //
- // AGASliderPP -------------------------------------------------------
- //
- // LControl subclass. To set/get the value, use the LControl value
- // methods. The mUserCon is used as the resource ID of an 'STR#' resource
- // that contains the slider labels; in this case, the range is
- // automatically set to match the number of labels, and the slider
- // will have a pointy indicator. If the ID is zero or invalid, the
- // slider will be rectangular.
- //
-
- class AGASliderPP : public LControl
- {
- public:
-
- AGASliderPP(LStream* inStream);
- virtual ~AGASliderPP();
-
- AGASlider* mAGAObject;
-
- enum { class_ID = 'GCsl' };
- static AGASliderPP* CreateStream(LStream* inStream);
-
- // PowerPlant overrides
- virtual void SetValue(SInt32 inValue);
- virtual void SetMinValue(SInt32 inMinValue);
- virtual void SetMaxValue(SInt32 inMaxValue);
-
- protected:
-
- // PowerPlant overrides
- virtual void FinishCreateSelf();
- virtual void DrawSelf();
- virtual void ClickSelf(const SMouseDownEvent &inMouseDown);
- virtual void EnableSelf();
- virtual void DisableSelf();
-
- virtual void CreateAGAObject();
-
- // Extra AGA object initialization values
- ResIDT mLabelsResourceID;
- ResIDT mLabelsTextTraitsID; // -1 for standard slider labels style
- SInt32 mSliderJustification; // not used for unlabled sliders
- };
-
- //
- // AGASliderPPX -------------------------------------------------------
- //
- // Extended AGASliderPP class for use with custom pane template.
- // The labels STR# resource ID, text traits ID, and justification
- // are read from the stream.
- //
-
- class AGASliderPPX : public AGASliderPP
- {
- public:
-
- AGASliderPPX(LStream* inStream);
- virtual ~AGASliderPPX();
-
- enum { class_ID = 'GXsl' };
- static AGASliderPPX* CreateStream(LStream* inStream);
- };
-
- //
- // AGALittleArrowsPP -------------------------------------------------------
- //
- // LControl subclass You will need to either install a notification
- // routine to respond to arrow tracking, or subclass and override
- // the HandleNotification member function. However:
- //
- // If you simply want to link the little arrows to a number LEditField
- // pane, just put the LEditField's pane ID the little arrows pane's
- // mUserCon, and the arrows will automatically increment/decrement
- // the LEditField view's value, within the value range of the little
- // arrows LControl settings.
- //
-
- class AGALittleArrowsPP : public LControl
- {
- public:
-
- AGALittleArrowsPP(LStream* inStream);
- virtual ~AGALittleArrowsPP();
-
- virtual void InstallNotificationRoutine(AGANotifyPPPtr notificationRoutine, void* userData);
- virtual void HandleNotification(SInt32 deltaValue);
-
- AGANotifyPPPtr mNotificationRoutine;
- void* mUserData;
-
- AGALittleArrows* mAGAObject;
-
- enum { class_ID = 'GCla' };
- static AGALittleArrowsPP* CreateStream(LStream* inStream);
-
- protected:
-
- // PowerPlant overrides
- virtual void FinishCreateSelf();
- virtual void DrawSelf();
- virtual void ClickSelf(const SMouseDownEvent &inMouseDown);
- virtual void EnableSelf();
- virtual void DisableSelf();
-
- virtual void CreateAGAObject();
-
- static void RealAGANotifier(AGALittleArrows* theAGAObject, SInt32 deltaValue, void* userData);
-
- LEditField* mLinkedNumberText;
-
- // Extra AGA object initialization values
- OSType mLinkedPaneID;
- };
-
- //
- // AGALittleArrowsPPX -------------------------------------------------------
- //
- // Extended AGALittleArrowsPP class for use with custom pane template.
- // The linked LEditField pane ID is read from the stream.
- //
-
- class AGALittleArrowsPPX : public AGALittleArrowsPP
- {
- public:
-
- AGALittleArrowsPPX(LStream* inStream);
- virtual ~AGALittleArrowsPPX();
-
- enum { class_ID = 'GXla' };
- static AGALittleArrowsPPX* CreateStream(LStream* inStream);
- };
-
- //
- // AGAPopupMenuPP -------------------------------------------------------
- //
- // LStdPopupMenu replacement subclass that implements an AGA popup menu.
- //
-
- class AGAPopupMenuPP : public LStdPopupMenu
- {
- public:
-
- AGAPopupMenuPP(LStream* inStream);
- virtual ~AGAPopupMenuPP();
-
- AGAPopupMenu* mAGAObject;
-
- enum { class_ID = 'GCpo' };
- static AGAPopupMenuPP* CreateStream(LStream* inStream);
-
- // PowerPlant overrides
- virtual void SetValue(SInt32 inValue);
-
- protected:
-
- // PowerPlant overrides
- virtual void FinishCreateSelf();
- virtual void DrawSelf();
- virtual void ClickSelf(const SMouseDownEvent &inMouseDown);
- virtual void EnableSelf();
- virtual void DisableSelf();
- virtual void ShowSelf();
-
- virtual void CreateAGAObject();
-
- SInt16 mStashedTitleWidth;
- };
-
- //
- // AGADisclosureTrianglePP -------------------------------------------------------
- //
- // LControl subclass Set/get the AGADisclosureTriangle state
- // directly. Think of it as a check box -- it's either on or off.
- // The initial on/off value is taken from the LControl value.
- //
-
- class AGADisclosureTrianglePP : public LControl
- {
- public:
-
- AGADisclosureTrianglePP(LStream* inStream);
- virtual ~AGADisclosureTrianglePP();
-
- AGADisclosureTriangle* mAGAObject;
-
- enum { class_ID = 'GCdt' };
- static AGADisclosureTrianglePP* CreateStream(LStream* inStream);
-
- protected:
-
- // PowerPlant overrides
- virtual void FinishCreateSelf();
- virtual void DrawSelf();
- virtual void ClickSelf(const SMouseDownEvent &inMouseDown);
- virtual void EnableSelf();
- virtual void DisableSelf();
-
- virtual void CreateAGAObject();
- };
-
- //
- // AGAProgressIndicatorPP -------------------------------------------------------
- //
- // LControl subclass. Use the standard LControl value methods to set the
- // progress indicator range and value. Access the AGAProgressIndicator
- // directly to set the origin value if desired. For indeterminate progress,
- // set min=max and then call Animate repeatedly.
- //
-
- class AGAProgressIndicatorPP : public LControl
- {
- public:
-
- AGAProgressIndicatorPP(LStream* inStream);
- virtual ~AGAProgressIndicatorPP();
-
- AGAProgressIndicator* mAGAObject;
-
- enum { class_ID = 'GCpr' };
- static AGAProgressIndicatorPP* CreateStream(LStream* inStream);
-
- // PowerPlant overrides
- virtual void SetValue(SInt32 inValue);
- virtual void SetMinValue(SInt32 inMinValue);
- virtual void SetMaxValue(SInt32 inMaxValue);
-
- protected:
-
- // PowerPlant overrides
- virtual void FinishCreateSelf();
- virtual void DrawSelf();
-
- virtual void CreateAGAObject();
- };
-
- //
- // AGAWhiteBackgroundAttachmentPP ----------------------------------------------------
- //
- // An attachment that you should attach to any subview where the window has
- // a gray background but the particular subview needs a white background.
- // Editable text fields and list boxes are the most common examples.
- // AGAEditFieldPP and AGAListBoxPP both add one of these automatically.
- //
-
- class AGAWhiteBackgroundAttachmentPP : public LAttachment
- {
- public:
-
- AGAWhiteBackgroundAttachmentPP(MessageT inMessage = msg_DrawOrPrint, Boolean inExecuteHost = true);
- AGAWhiteBackgroundAttachmentPP(LStream *inStream);
-
- enum { class_ID = 'GCwa' };
- static AGAWhiteBackgroundAttachmentPP* CreateStream(LStream* inStream);
-
- virtual Boolean Execute(MessageT inMessage, void *ioParam);
- };
-
- //
- // AGABorderFrameAttachmentPP ----------------------------------------------------
- //
- // An attachment that you should attach to any subview where the subview
- // needs a "3D" sunken frame around it. Editable text fields and list
- // boxes are the most common examples.
- // AGAEditFieldPP and AGAListBoxPP both add one of these automatically.
- //
-
- class AGABorderFrameAttachmentPP : public LAttachment
- {
- public:
-
- AGABorderFrameAttachmentPP(MessageT inMessage = msg_DrawOrPrint, Boolean inExecuteHost = true);
- AGABorderFrameAttachmentPP(LStream *inStream);
-
- enum { class_ID = 'GCba' };
- static AGABorderFrameAttachmentPP* CreateStream(LStream* inStream);
-
- virtual Boolean Execute(MessageT inMessage, void *ioParam);
- };
-
- //
- // AGAEditFieldPP -------------------------------------------------------
- //
- // LEditField subclass that attaches an AGAWhiteBackgroundAttachmentPP
- // and an AGABorderFrameAttachmentPP to itself.
- // It also knows how to draw the disabled text frame in gray color
- // rather than dithered black pattern.
- //
-
- class AGAEditFieldPP : public LEditField
- {
- public:
-
- AGAEditFieldPP(LStream* inStream);
- virtual ~AGAEditFieldPP();
-
- enum { class_ID = 'GCed' };
- static AGAEditFieldPP* CreateStream(LStream* inStream);
-
- protected:
-
- virtual void DrawBox();
-
- };
-
- //
- // AGATextEditPP -------------------------------------------------------
- //
- // LTextEdit subclass that attaches an AGAWhiteBackgroundAttachmentPP
- // and an AGABorderFrameAttachmentPP to itself.
- //
-
- class AGATextEditPP : public LTextEdit
- {
- public:
-
- AGATextEditPP(LStream* inStream);
- virtual ~AGATextEditPP();
-
- enum { class_ID = 'GCte' };
- static AGATextEditPP* CreateStream(LStream* inStream);
- };
-
- //
- // AGASeparatorPP -------------------------------------------------------
- //
- // LPane subclass that implements an AGA separator.
- //
-
- class AGASeparatorPP : public LPane
- {
- public:
-
- AGASeparatorPP(LStream* inStream);
- virtual ~AGASeparatorPP();
-
- AGASeparator* mAGAObject;
-
- enum { class_ID = 'GCse' };
- static AGASeparatorPP* CreateStream(LStream* inStream);
-
- protected:
-
- // PowerPlant overrides
- virtual void FinishCreateSelf();
- virtual void DrawSelf();
-
- virtual void CreateAGAObject();
- };
-
- //
- // AGACaptionPP -------------------------------------------------------
- //
- // LCaption replacement subclass. Dims with gray text instead of
- // patBic gray pattern erasing; suppresses erasing background to white
- // when text is changed.
- //
-
- class AGACaptionPP : public LCaption
- {
- public:
-
- AGACaptionPP(LStream* inStream);
- virtual ~AGACaptionPP();
-
- AGAStaticText* mAGAObject;
-
- enum { class_ID = 'GCca' };
- static AGACaptionPP* CreateStream(LStream* inStream);
-
- // PowerPlant overrides
- virtual void SetDescriptor(ConstStringPtr inDescriptor);
- virtual void SetValue(SInt32 inValue);
-
- protected:
-
- // PowerPlant overrides
- virtual void FinishCreateSelf();
- virtual void DrawSelf();
-
- virtual void CreateAGAObject();
- };
-
- //
- // AGAListBoxPP -------------------------------------------------------
- //
- // LListBox replacement subclass that replaces the default LFocusBox
- // with an AGAFocusBoxPP AGA-style focus frame, and attaches an
- // AGAWhiteBackgroundAttachmentPP and an AGABorderFrameAttachmentPP to
- // itself.
- //
-
- class AGAListBoxPP : public LListBox
- {
- public:
-
- AGAListBoxPP(LStream* inStream);
- virtual ~AGAListBoxPP();
-
- enum { class_ID = 'GClb' };
- static AGAListBoxPP* CreateStream(LStream* inStream);
-
- protected:
-
- // PowerPlant overrides
- virtual void FinishCreateSelf();
- };
-
- //
- // AGAFocusBoxPP -------------------------------------------------------
- //
- // LFocusBox replacement subclass that implements an AGA focus frame.
- // The AGAListBoxPP class replaces the standard LFocusBox with one of
- // these.
- //
-
- class AGAFocusBoxPP : public LFocusBox
- {
- public:
-
- AGAFocusBoxPP();
- AGAFocusBoxPP(const LFocusBox &inOriginal);
- AGAFocusBoxPP(LStream* inStream);
- virtual ~AGAFocusBoxPP();
-
- enum { class_ID = 'GCfb' };
- static AGAFocusBoxPP* CreateStream(LStream* inStream);
-
- protected:
-
- virtual void ComputeBorderRegion(RgnHandle borderRegion);
-
- // PowerPlant overrides
- virtual void DrawSelf();
- };
-
- #endif // __GRAYCOUNCILPP__
-
-